<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition template="/templates/principal_template.xhtml">
	<ui:define name="pageTitle">Login - jMed Systems</ui:define>
	<ui:define name="pageScrips"></ui:define>
	<ui:define name="pageCss"></ui:define>

	<ui:define name="imgTopContent"></ui:define>
	<ui:define name="imgTopLabelContent"></ui:define>
	<ui:define name="label_page_content"></ui:define>
	<p></p>

	<ui:define name="imgTopLabelContent">
			<p>Consulta Hospital</p>
	</ui:define>

	<ui:define name="contentMain">
		<br />
		<h:form id="form-materiais-hospital">
			<rich:panel>
				<rich:messages />
				<h:panelGrid columns="2">

					<h:outputText value="Código" />
					<h:inputText value="#{cadastroControl.hospital.codigo}" />

					<h:outputText value="Descrição" />
					<h:inputText value="#{cadastroControl.hospital.nomeFantasia}"/>

					<h:commandButton action="#{cadastroControl.pesquisarHospital}"
						value="Pesquisar" />

					<h:commandButton action="#{cadastroControl.novoCadastroHospital}"
						value="Novo" />
				</h:panelGrid>
			</rich:panel>
		</h:form>
		<br />

		<rich:dataTable style="width: 100%" id="grid-pesq-materiai"
			value="#{cadastroControl.hospitalList}" var="item">
			<f:facet name="header">
				<rich:columnGroup>
					<rich:column style="width: 10%">
						<h:outputText value="Código" />
					</rich:column>
					<rich:column style="width: 10%;">
						<h:outputText value="CNPJ" />
					</rich:column>
					<rich:column style="width: 55%;">
						<h:outputText value="Nome" />
					</rich:column>

					<rich:column style="width: 15%;">
						<h:outputText value="Opções" />
					</rich:column>

				</rich:columnGroup>
			</f:facet>
			<rich:column>
				<h:outputText value="#{item.codigo}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{item.cnpj}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{item.nomeFantasia}" />
			</rich:column>
			<rich:column>
				<h:panelGrid columns="2">
					<h:form id="form-act-hospital">
						<h:commandButton
							action="#{cadastroControl.abrirAlterarHospital(item)}" 
							image="/templates/images/document_edit.png" id="btnAlterar">
							<rich:tooltip value="Alterar" attached="btnAlterar" />
						</h:commandButton>

					</h:form>
				</h:panelGrid>
			</rich:column>
		</rich:dataTable>
	</ui:define>
</ui:composition>

</html>